home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.std.c
- Subject: Re: Alignment of malloc()
- Date: Sat, 06 Jan 96 18:57:31 GMT
- Organization: none
- Message-ID: <820954651snz@genesis.demon.co.uk>
- References: <DKDA7D.Kw7@midway.uchicago.edu> <j66Sx*FRe@yaps.rhein.de> <DKKHCH.L6r@midway.uchicago.edu>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <DKKHCH.L6r@midway.uchicago.edu>
- mps@geodesic.com "Michael Spertu" writes:
-
- >For this reason, the two possibilities are:
- >
- >1) All the texts (including K & R) are advocating code that is not reasonable
- >on (the most common) compliant implementations of C.
-
- It is not the responsibility of C language texts to pay lip-service to a
- particular implmentation (otherwise we'd all be using near+far pointers,
- inline assembly etc). Rather it is up to the implementation to
-
- a) conform to the language specs., which is objective
-
- b) provide a reasonable 'quality' (including features, performance etc.) a
- great deal of which is subjective. If you have a poorly performing
- implementation, the implementation needs to be fixed, not the language
- or the textbooks. An inefficient implementation of printf is (or can be)
- still conforming. You don't go and change all the textbooks just because
- an implementor was lazy.
-
- >2) 32 bit alignment of malloc() on PCs is not compliant.
-
- It always has been and still is.
-
- >Either possibility is very serious, and violates assumptions that most
- >programmers take for granted
-
- It is the implementation that violated the programmer's assumptions. This
- has nothing to do with the C standard or C language textbooks. It may
- have some relevance to PC/Windows programming textbooks.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-